﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type="text/javascript">
        window.onbeforeunload = function(event){
            event.returnValue = "你真的要离开么！";
            return;
        }


        document.onreadystatechange = function () {
            alert(document.readyState);
        }

    </script>
</head>
<body>
    <h1>离开网页测试</h1>
</body>
</html>
